@echo off
chcp 65001 >nul
echo ========================================
echo    ITS System Startup Script
echo ========================================
echo.
echo Starting all services...

cd /d "%~dp0"

echo [1/4] Starting database service...
docker-compose up -d database

echo Waiting for database to start...
timeout /t 5 /nobreak >nul

echo [2/4] Starting backend service...
docker-compose up -d backend

echo Waiting for backend service to start...
timeout /t 10 /nobreak >nul

echo [3/4] Starting frontend service...
docker-compose up -d frontend

echo Waiting for frontend service to start...
timeout /t 10 /nobreak >nul

echo [4/4] Starting Nginx proxy...
docker-compose up -d nginx

echo.
echo ========================================
echo    Services started successfully!
echo ========================================
echo.
echo Access URLs:
echo - Full System: http://localhost:8080
echo - API Docs: http://localhost:8001/docs
echo - Backend API: http://localhost:8001/api
echo.
echo Check service status: docker-compose ps
echo View service logs: docker-compose logs
echo Stop all services: docker-compose down
echo.
pause